package com.wasion.pwportable.protocol.p2;

/**
 * 
 * @ClassName: FlowCMDEnum
 * @Description: 流程命令的枚举
 * @author 高意
 * @date Apr 13, 2016 7:58:17 PM
 * 
 */
public enum FlowCMDEnum {

	RESET_CMD("复位终端", 0), // 0
	INITIALIZE_CMD("初始化", 1), // 1
	ALL_DATA_COLLECT_CMD("总召唤", 2), // 2
	GROUP_DATA_COLLECT_CMD("分组召唤", 3), // 3
	REMOTE_CON_PREPARE_CMD("遥控-预置", 4), // 4
	REMOTE_CON_CANCEL_CMD("遥控-撤销", 5), // 5
	REMOTE_CON_EXEC_CMD("遥控-执行", 6), // 6
	SYNC_TIME_CMD("对时", 7), // 7
	TEST_CMD("测试命令", 8), // 8
	AUTO_UPLOAD_CMD("", 9), // 9
	AUTO_UPLOAD_CANCEL_CMD("", 10), // 10
	GET_PARAM_CMD("扩展参数-读取", 11), // 11
	SET_PARAM_CMD("扩展参数-写入", 12), // 12
	COMM_PARAM_SEND_CMD("", 13), // 13
	COMM_PARAM_CANCEL_CMD("", 14), // 14
	COMM_PARAM_EXEC_BEGIN_CMD("", 15), // 15
	FTP_PARAM_SEND_BEGIN_CMD("", 16), // 16
	FTP_PARAM_SEND_CANCEL_CMD("", 17), // 17
	FTP_PARAM_SEND_EXEC_CMD("", 18), // 18
	SET_PASSWORD_CMD("扩展参数-设置密码", 19), // 19
	HIS_COLLCET_CMD("冻结数据-读取", 20), // 20
	HIS_ALARM_CMD("", 21), // 21
	READ_FILE_DIR_CMD("读文件目录", 22), // 
	READ_FILE_CMD("读文件", 23), //
	ExecutCmd_BUTT("End", 24); // 24

	// 成员变量，枚举名称(说明)和索引
	private String name;
	private int index;

	// 构造方法
	private FlowCMDEnum(String name, int index) {
		this.name = name;
		this.index = index;
	}

	// 普通方法
	public static String getName(int index) {
		for (FlowCMDEnum c : FlowCMDEnum.values()) {
			if (c.getIndex() == index) {
				return c.name;
			}
		}
		return null;
	}

	// get set 方法
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}
}
